<template>
  <div class="navbar">
    <div class="navbar-left" v-if="$slots.left">
      <slot name="left"></slot>
    </div>
    <div class="navbar-center" v-if="$slots.center">
      <slot name="center"></slot>
    </div>
    <div class="navbar-right" v-if="$slots.right">
      <slot name="right"></slot>
    </div>
    <h1 class="navbar-title" v-if="title" >
        <span v-text="title" class="navbar-text"></span>
    </h1>
  </div>
</template>
<script>
export default {
  name: "navbar",
  props: {
    title: {
      type: String,
      default: ""
    }
  }
};
</script>
<style lang="scss" scoped>
@import "../../assets/sass/_mixins.scss";
.navbar {
  position: relative;
  @include flex-between();
  height: 50px;
  background-color: white;

  &-left {
    margin-left: 10px;
    ~ .navbar-right{
        position: static;
    }
  }
  &-center {
    flex: 1;
    margin: 0 10px;
    ~ .navbar-right{
        position: static;
    }
  }
  &-right {
    position: absolute;
    right: 0;
    @include flex-center();
    height: 100%;
    margin-right: 10px;
  }
  &-title {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20%;
    right: 20%;
    @include flex-center();
    
  }
  &-text{
    font-size: 18px;
    @include ellipsis();
  }
}
</style>